package com.example.demo.day.config.learn.design.responsibity.x1;

public class x1MainTest {

    public static void main(String[] args) {
        Leader boss = new Boss(null);
        Leader manger = new Manger(boss);
        Leader director = new Director(manger);
        Leader grouper = new Grouper(director);
        Leader xiaming = new Member(grouper,"小明");

        printRequestState(xiaming.dispatchRequest(1));
        printRequestState(xiaming.dispatchRequest(100));
        printRequestState(xiaming.dispatchRequest(10230));
        printRequestState(xiaming.dispatchRequest(34342));
        printRequestState(xiaming.dispatchRequest(10112320));


    }

    public static void printRequestState(boolean isSuccess) {
        if (isSuccess) {
            System.out.println("* 小李报销成功");
        } else {
            System.out.println("* 没有人批复，小李报销失败");
        }
    }
}
